package com.suixinsanren.design.observer.demo04;

import org.junit.Test;

import java.sql.Date;

public class WeatherStationTestDrive {

    @Test
    public void test() {
        WeatherStation station = new WeatherStation();
        AverageDisplay averageDisplay = new AverageDisplay();
        StatisticsDisplay statisticsDisplay = new StatisticsDisplay();
        station.addObserver(averageDisplay);
        station.addObserver(statisticsDisplay);
        station.update(30, 20, 23, 30, new Date(120, 4, 29));
        station.update(29, 21, 26, 20, new Date(121, 4, 30));
    }
}
